﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JAAF.UI
{
    public abstract class UIWizardProcess: UIProcess
    {
        protected UIWizardProcess(UIApplication _oApplication)
            : base(_oApplication)
        {
            this._InitializeCommands();
        }


        #region Command management

        private void _InitializeCommands()
        {
            this.NextCommand = new DelegateCommand(this._NextCommandHandler);
            this.PreviousCommand = new DelegateCommand(this._PreviousCommandHandler);
        }

        /// <summary>
        /// Gets the <see cref="IUICommand">command</see> that invokes the <see cref="UIWizardProcess.GoToNextStep"/> method
        /// of the wizard user interface process.
        /// </summary>
        public IUICommand NextCommand
        {
            get;

            private set;
        }

        private void _NextCommandHandler(object _oArgument)
        {
            this.GoToNextStep();
        }

        /// <summary>
        /// Gets the <see cref="IUICommand">command</see> that invokes the <see cref="UIWizardProcess.GoToPreviousStep"/> method
        /// of the wizard user interface process.
        /// </summary>
        public IUICommand PreviousCommand
        {
            get;

            private set;
        }

        private void _PreviousCommandHandler(object _oArgument)
        {
            this.GoToPreviousStep();
        }

        #endregion


        #region Methods

        public abstract void GoToNextStep();

        public abstract void GoToPreviousStep();

        #endregion

    }
}
